home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_10832.txt < prev    next >
Text File  |  1991-02-27  |  758b  |  33 lines

  1. -- card: 10832 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. Any object which is defined with class Person will contain integer instance variables representing age and weight.  The only procedures which act on this data are: setting the values and printing the values.  These methods may be defined by:
  11.  
  12.     Person::set()
  13.     {
  14.         age = 28;
  15.         weight = 150;
  16.     }
  17.  
  18.     Person::print()
  19.     {
  20.         printf("%d ",age);
  21.         printf("%d",weight);
  22.     }
  23.  
  24. ('printf()' is a standard C library function discussed in the next section.)
  25.  
  26.  
  27. -- part contents for background part 7
  28. ----- text -----
  29. 14
  30.  
  31. -- part contents for background part 17
  32. ----- text -----
  33. p17